A. Field of the Invention
The present invention relates to an apparatus and method for image processing, especially to an apparatus and method adaptable for an 8-bit or a 10-bit AID converter to provide multiple extra bits for post image processing, thereby to improve the color fidelity of the digital image signals after post processing.
B. Description of the Prior Art
It is known that the precision of tone for a scanned image is determined by the image bit depth. The scanners currently available in the market present various specifications of image bit depth, such as 24-bit color, 30-bit color, 36-bit color, or even 42-bit color. These scanners differ in the capability of Analog/Digital converters (hereinafter AID converter). An 8-bit AID converter can generate 256 (28) colors for each channel, that is, 24-bit color images. In contrast, a 12-bit AID converter can generate 4096 (212) colors for each channel. Nevertheless, according to the nowadays technology, regardless of the capability of the AID converter, the images shown on the screen or sent to the printer are limited to 8-bit of data for each channel. Moreover, most image processing software can only accept 8-bit of data for each channel. Accordingly, the extra bits other than the 8-bit data obtained from the AID converter will seem redundant when they are forwarding to the host computer. Once the post processing is required for the digital image signals, such as Gamma correction or highlight/shadow adjustment, those extra bits may become very useful.
Take Gamma correction as an example, Gamma correction is for increasing the color levels of a pixel so as to brighten the image and enhance the visibility of the pixels, especially for those dark ones. Refer to FIG. 1A, it is a histogram illustrating an original image which has not been processed yet. Since the original image is unprocessed, so it can show all the 256 colors. The histogram representing this situation is a continuous diagram. In that case, if all three channels can distinguish 256 colors, then the 24-bit color image can have 16777216 colors (256xc3x97256xc3x97256) in it.
FIG. 1B and FIG. 1C are histograms showing the same channel of the same scanned image as FIG. 1A after being processed by Gamma correction. The Gamma value for FIG. 1B is 1.4. On the other hand, the Gamma value for FIG. 1C is 1.8. Refer to FIG. 1B, it shows that only 225 colors out of 256 colors can be shown. In that case, the histogram is discontinuous. In other words, the 24-bit colors can only present 11390625 (225xc3x97225xc3x97225) colors which are only 67.89% of 16777216. Refer to FIG. 1C, the histogram shows that only 203 colors out of 256 colors can be shown. The 24-bit colors of FIG. 1C can only present 8365427 (203xc3x97203xc3x97203) colors, which are only 49.86% of 16777216.
Basically, the above mentioned problem can be solved by using extra bits in post processing. The current technology provides two approaches: a complete computation approach, and a simplified computation approach. The complete computation approach takes the entire image signal output of the scanner and leaves the complicated computation to the host computer for processing. The complete computation usually needs large buffer memory size, and complicated computation circuit implementation. Although this approach can guarantee the accuracy of the image data, the data size is so large that the speed of computation as well as data transfer gets very slow. For this reason, this approach is not commercially competitive considering the cost, memory and resource utilization.
Another simplified computation approach is that the scanner only outputs 8-bit data to the host computer for post processing. The image enhancement is left for the software to process. In most cases, this method can generate extra bits for a current pixel by calculating an average of the neighboring pixels around a current pixel, or by calculating and assigning weights to the neighboring pixels before post processing. However, the disadvantage is that these computations may affect the system performance, especially when processing images of very large sizes. Moreover, the average or weights will affect the accuracy of the original image data. If not handled properly, it may cause the image to be blurred.
Accordingly, it is an object of the present invention to provide an apparatus and method for providing compensation bits for post processing. The compensation bits are extra bits attached to the rightmost insignificant bit positions of the original pixel to increase the image bit depth of the original pixel, thereby to compensate the loss of accuracy after Gamma correction. Moreover, the hardware implementation of the apparatus of the present invention is so simple that it will not increase the manufacturing cost, nor affect post processing speed while still can preserve the accuracy of the original pixels.
The apparatus of the present invention mainly comprises: a post-pixel memory device, a current pixel memory device, a shifting device, a pre-pixel memory device, a QBET (Quick Bit Extension Technology, herein after QBET) operating device, and a Join device. The post-pixel memory device is coupled to an analog/digital converter for receiving the output of the analog/digital converter. The two least significant bits of the output of the post-pixel memory device will be forwarded to the QBET operating device. The current pixel memory device is coupled to the post-pixel memory device for receiving the output of the post-pixel memory device. The output of the current pixel memory device will be forwarded to the shifting device and the pre-pixel memory device. The two least significant bits of the pre-pixel memory device will be forwarded to the QBET operating device.
During the same time, the shifting device will perform left-shifting two bits on the bits received. After that, the left-shifted bits will be forwarded to the Join device. The QBET operating device can generate the compensation bits by computing the two least significant bits or by looking up a built-in table. The compensation bits will then be forwarded to a Join device. Then, the Join device appends the two compensation bits to the output of the shifting device. Consequently, the current pixel will be extended with two bits. Since the extended bitstream contains the entire bits of the original pixel, therefore the accuracy of the original pixel can be preserved. Moreover, the extended two bits can increase the image bit depth, and compensate the loss of accuracy after post processing.